<template>
  <div class="components-container">
    <!-- 编辑 -->
    <sweet-modal ref="dialog" class="dialog" :sweetModalMaxWidth="pageWidth">
      <h3>{{title}}</h3>
      <div :style="{maxHeight:maxHeight+'px'}" style="overflow:auto;">
        <fieldset class="layui-elem-field layui-field-title">
          <legend style="font-weight: bold;">死者基本信息</legend>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label text-danger">逝者类型</label>
              <div class="layui-input-inline ">
                <el-select v-model="jpmData.JPMTYPE">
                  <el-option v-for="item in szlx" :key="item.Value" :label="item.Text" :value="item.Value" :disabled="item.disabled">
                  </el-option>
                </el-select>
              </div>
            </div>
          <!-- <div class="layui-inline" v-if="this.isshowbmmc">
              <label class="layui-form-label text-danger">逝者类型</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMTYPE"></el-input>
              </div>
            </div> -->
            <div class="layui-inline" >
                <label class="layui-form-label">填报单位</label>
                <div class="layui-input-inline ">
                  <el-input :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入单位" v-model="jpmData.JPMREPORTUNITDESC" readonly></el-input>
                </div>
            </div>
             <div class="layui-inline" v-if='IsHaveAcceptancePlatform'>
              <label class="layui-form-label">预约编号</label>
              <div class="layui-input-inline">
                <el-input v-model="jpmData.DECNO" style="width: 160px;" :readonly="!isgai"></el-input>
              </div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label text-danger">逝者姓名</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMNAME"></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">逝者性别</label>
              <div class="layui-input-inline ">
                <el-select v-model="jpmData.JPMSEX" filterable>
                  <el-option v-for="item in xblx" :key="item.CODNAME" :label="item.CODALIAS" :value="item.CODNAME">
                  </el-option>
                </el-select>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">逝者年龄</label>
              <div class="layui-input-inline ">
                <el-input-number style="width:160px;" v-model="jpmData.JPMAGE" :min="0"></el-input-number>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">证件类型</label>
              <div class="layui-input-inline">
                <el-select v-model="jpmData.JPMCARDTYPE" filterable>
                  <el-option v-for="item in sfzjlx" :key="item.CODNAME" :label="item.CODALIAS" :value="item.CODNAME">
                  </el-option>
                </el-select>
              </div>
            </div>
            <div class="layui-inline" style="width:575px;margin-right:0px;">
                <label class="layui-form-label text-danger">证件号码</label>
                <div class="layui-input-inline ">
                  <el-input class="longertext" @blur="regzheng()" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入证件号码" v-model="jpmData.JPMCARDNO"></el-input>
                </div>
            </div>
          </div>

          <div class="layui-inline-item">
            <div class="layui-inline" style="width:900px;margin-right:0px;">
                <label class="layui-form-label">户籍地址</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入户籍地址" v-model="jpmData.JPMDETAILADDRESS"></el-input>
                </div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label text-danger">死亡原因</label>
              <div class="layui-input-inline ">
                <el-cascader :options="cause" v-model="jpmData.JPMCAUSA" filterable>
                </el-cascader>
              </div>
              <div class="layui-input-inline " style="width:294px">
                <el-input v-model="jpmData.JPMCAUSEOTHER"></el-input>
              </div>
            </div>
             <div class="layui-inline">
              <label class="layui-form-label">死亡地点</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMDEATHADDRESS" style="width:160px"></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label text-danger">死亡日期</label>
              <div class="layui-input-inline ">
                <el-date-picker v-date type="date" v-model="datatime.JPMDEATHDATE"  @change="(value) => birthdaydata(datatime.JPMBIRTHDATE)"></el-date-picker>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">出生日期</label>
              <div class="layui-input-inline ">
                <el-date-picker v-date type="date" v-model="datatime.JPMBIRTHDATE"  @change="(value) => birthdaydata(value)"></el-date-picker>
              </div>
            </div>
            <div class="layui-inline" v-if="showmodel">
                <label class="layui-form-label">预约日期</label>
                <div class="layui-input-inline">
                  <el-date-picker v-date type="date"  style="width:160px" v-model="jpmData.TSKDATE" @change="(value) => appointmentpick(jpmData.TSKDATE)"></el-date-picker>
                </div>
            </div>
          </div>
          <div class="layui-form-item" v-if="showtimeduan">
            <div class="layui-inline">
                <label class="layui-form-label">时间段</label>
                <div class="layui-input-inline">
                    <el-select v-model="TSPID" clearable filterable @change="pickuptimedata">
                        <el-option v-for="item in carTimes" :key="item.TSPID" :label="item.Period" :value="item.TSPID">
                        </el-option>
                    </el-select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" >已预约数量</label>
                <div class="layui-input-inline">
                    <el-input type="text" v-model="carTimenex.TSKHASCOUNT"  style="width:190px" readonly></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width:122px">最多可预约数量</label>
                <div class="layui-input-inline" style="width:129px">
                    <el-input type="text" v-model="carTimenex.TSPNUBER"  readonly></el-input>
                </div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label text-danger">家属姓名</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKMAN"></el-input>
                </div>
            </div>
            <div class="layui-inline" v-if="isshow">
              <label class="layui-form-label text-danger">待办地址</label>
              <div class="layui-input-inline" style="width:500px">
                <el-cascader style="width:466px" v-model="arr" :options="addressOptions" clearable >
              </el-cascader>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">证件类型</label>
              <div class="layui-input-inline">
                <el-select v-model="jpmData.JPMLINKLERCARDTYPE" filterable>
                  <el-option v-for="item in sfzjlx" :key="item.CODNAME" :label="item.CODALIAS" :value="item.CODNAME">
                  </el-option>
                </el-select>
              </div>
            </div>
            <div class="layui-inline" style="width:575px;margin-right:0px;">
                <label class="layui-form-label text-danger">证件号码</label>
                <div class="layui-input-inline">
                  <el-input class="longertext" style="width: 466px;" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入证件号码" v-model="jpmData.JPMLINKLERCARDNO"></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label text-danger">逝者关系</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKRELATION"></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label text-danger">联系电话</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKPHONE"></el-input>
                </div>
            </div>
            <div class="layui-inline" v-if="this.OrganOptions.length > 1">
                <label class="layui-form-label text-danger">所属殡仪馆</label>
                <div class="layui-input-inline">
                    <el-select v-model="jpmData.JPMPVDNO"  style="width: 160px" filterable>
                        <el-option v-for="item in OrganOptions" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </div>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-inline" style="width:900px;margin-right:0px;">
                <label class="layui-form-label">联系地址</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入联系地址" v-model="jpmData.JPMLINKLERHOUSEHOLD"></el-input>
                </div>
            </div>
          </div>

         
          <div class="layui-form-item">
           <div class="layui-inline" style="width:290px;">
                <label class="layui-form-label">是否残疾：</label>
                <el-radio-group v-model="jpmData.JPMISDEFORMITY" style="margin-top:7px;">
                  <el-radio disabled label="B">是</el-radio>
                  <el-radio disabled label="A">否</el-radio>
                </el-radio-group> 
            </div>
            <!-- <div class="layui-inline" style="width:290px;">
                <label class="layui-form-labels">是否交满一年社保：</label>
                <el-radio-group v-model="jpmData.JPMISSOCIAL" style="margin-top:7px;">
                  <el-radio disabled label="B">是</el-radio>
                  <el-radio disabled label="A">否</el-radio>
                </el-radio-group> 
            </div> -->
          </div>
          </fieldset>
          <fieldset class="layui-elem-field layui-field-title" v-if="false">
            <legend style="font-weight: bold;">火化信息反馈</legend>

              <div class="layui-form-item">
                <div class="layui-inline">
                  <label class="layui-form-label" style="width:90px;">火化日期</label>
                  <div class="layui-input-inline ">
                    <el-date-picker v-date type="date" v-model="jpmData.JPMCREMATIONDATE"></el-date-picker>
                  </div>
                </div>
              </div>


              <div class="layui-form-item">
                <div class="layui-inline">
                  <label class="layui-form-label" style="width:90px;">申请人姓名</label>
                  <div class="layui-input-inline ">
                    <el-input v-model="jpmData.JPMHANDLERNAME"></el-input>
                  </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">关系</label>
                    <div class="layui-input-inline ">
                      <el-input v-model="jpmData.JPMRELATION"></el-input>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">联系电话</label>
                    <div class="layui-input-inline ">
                      <el-input v-model="jpmData.JPMHANDLERLINK"></el-input>
                    </div>
                </div>
              </div>

              <div class="layui-form-item">
                <div class="layui-inline">
                  <label class="layui-form-label" style="width:90px;">身份证号码</label>
                  <div class="layui-input-inline ">
                    <el-input v-model="jpmData.JPMHANDLERCARDNO" @change="(value) => identityNumber(value)"></el-input>
                  </div>
                </div>
                <div class="layui-inline" style="width:575px;margin-right:0px;">
                  <label class="layui-form-label">联系地址</label>
                  <div class="layui-input-inline ">
                    <el-input class="longertext" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入详细地址" v-model="jpmData.JPMHANDLERHOUSEHOLD">
                    </el-input>
                  </div>
                </div>
                <div class="layui-inline-item">
                  <div class="layui-inline" style="width:850px;margin-right:0px;">
                      <label class="layui-form-label" style="width:90px;">备注</label>
                      <div class="layui-input-inline ">
                        <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="备注" v-model="jpmData.JPMREMARK"></el-input>
                      </div>
                  </div>
                </div>
            </div>
          </fieldset>
       
        <fieldset class="layui-elem-field layui-field-title" v-if="false">
          <legend style="font-weight: bold;">公安注销反馈</legend>

          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">办理日期</label>
              <div class="layui-input-inline ">
                <el-date-picker v-date type="date" v-model="jpmData.JPMCANCELDATE"></el-date-picker>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">单位</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMCANCELUNIT"></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">人员</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMCANCELUSR"></el-input>
              </div>
            </div>
          </div> 

          <div class="layui-inline-item">
            <div class="layui-inline" style="width:850px;margin-right:0px;">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="备注" v-model="jpmData.JPMCANCELREMARK"></el-input>
                </div>
            </div>
          </div>
        </fieldset>
        <!-- <fieldset class="layui-elem-field layui-field-title" v-if="false">
          <legend style="font-weight: bold;">社保信息反馈</legend>

          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">停发日期</label>
              <div class="layui-input-inline ">
                <el-date-picker v-date type="date" v-model="jpmData.regDeathDate"></el-date-picker>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">经办人员</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMSOCIALREMARK"></el-input>
              </div>
            </div>
          </div> 
          
          <div class="layui-inline-item">
            <div class="layui-inline" style="width:850px;margin-right:0px;">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="备注" v-model="jpmData.JPMSOCIALREMARK"></el-input>
                </div>
            </div>
          </div>

        </fieldset> -->
      </div>
      <div class="layui-form-item btnCenter">
        <el-button @click="closeDialog">取消</el-button>
        <el-button  type="primary" @click="submit" :loading="this.$store.state.isloading">保存</el-button>
         <el-button type="primary" @click="getifmation" :loading="this.$store.state.isloading">获取</el-button>
          <!-- <el-button type="primary" @click="datas" :loading="this.$store.state.isloading">数据</el-button> -->
      </div>
    </sweet-modal>

    <!-- 详情 -->
    <sweet-modal ref="dialogdetail" class="dialog" :sweetModalMaxWidth="pageWidth">
      <h3>{{title}}</h3>
      <div :style="{maxHeight:maxHeight+'px'}" style="overflow:auto;">
        <fieldset class="layui-elem-field layui-field-title">
          <legend style="font-weight: bold;">死者基本信息</legend>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">逝者类型</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMTYPES" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">填报单位</label>
                <div class="layui-input-inline ">
                  <el-input  :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入单位" v-model="jpmData.JPMREPORTUNITDESC" readonly></el-input>
                </div>
            </div>
              <div class="layui-inline" v-if='IsHaveAcceptancePlatform'>
              <label class="layui-form-label">预约编号</label>
              <div class="layui-input-inline">
                <el-input v-model="jpmData.DECNO" style="width: 160px;" readonly></el-input>
              </div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">逝者姓名</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMNAME" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">逝者性别</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMSEXS" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">逝者年龄</label>
              <div class="layui-input-inline ">
                <el-input style="width:160px;" v-model="jpmData.JPMAGE" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">证件类型</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMCARDTYPE" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline" style="width:575px;margin-right:0px;">
                <label class="layui-form-label">证件号码</label>
                <div class="layui-input-inline ">
                  <el-input class="longertext" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入证件号码" v-model="jpmData.JPMCARDNO" readonly></el-input>
                </div>
            </div>
            <!-- <div class="layui-inline">
              <label class="layui-form-label">证件号码</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.REGCARDNO" @change="(value) => identityNumber(value)"></el-input>
              </div>
            </div> -->
          </div>

          <div class="layui-inline-item">
            <div class="layui-inline" style="width:900px;margin-right:0px;">
                <label class="layui-form-label">户籍地址</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入户籍地址" v-model="jpmData.JPMDETAILADDRESS" readonly></el-input>
                </div>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-inline" style="width: 566px;">
              <label class="layui-form-label">死亡原因</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMCAUSAS" readonly></el-input>
              </div>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMCAUSEOTHER" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">死亡地点</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMDEATHADDRESS" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">死亡日期</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMDEATHDATE" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">出生日期</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMBIRTHDATE" readonly></el-input>
              </div>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">家属姓名</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKMAN" readonly></el-input>
                </div>
            </div>
             <div class="layui-inline" v-if="isshow">
              <label class="layui-form-label">待办地址</label>
              <div class="layui-input-inline" style="width:500px">
                <el-cascader style="width:466px"  v-model="arr" :options="addressOptions" readonly>
              </el-cascader>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">证件类型</label>
              <div class="layui-input-inline ">  
                  <el-input v-model="jpmData.JPMLINKLERCARDTYPE" readonly></el-input>  
                </div>
            </div>
            <div class="layui-inline" style="width:575px;margin-right:0px;">
                <label class="layui-form-label">证件号码</label>
                <div class="layui-input-inline ">
                  <el-input class="longertext" :autosize="{ minRows: 2, maxRows: 8}" v-model="jpmData.JPMLINKLERCARDNO" readonly></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">逝者关系</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKRELATION" readonly></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">联系电话</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKPHONE" readonly></el-input>
                </div>
            </div>
            <div class="layui-inline" v-if="this.OrganOptions.length > 1">
                <label class="layui-form-label">所属殡仪馆</label>
                <div class="layui-input-inline ">
                    <el-select v-model="jpmData.JPMPVDNO" disabled>
                        <el-option v-for="item in OrganOptions" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </div>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-inline" style="width:900px;margin-right:0px;">
                <label class="layui-form-label">联系地址</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入联系地址" v-model="jpmData.JPMLINKLERHOUSEHOLD" readonly></el-input>
                </div>
            </div>
          </div>
          <!-- <div class="layui-inline-item" v-if="this.title == '户口注销'">
            <div class="layui-inline" style="width:850px;margin-right:0px;">
                <label class="layui-form-label">注销备注</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入户籍地址" v-model="jpmData.JPMCANCELREMARK"></el-input>
                </div>
            </div>
          </div> -->
          <div class="layui-form-item">
            <!-- <div class="layui-inline" style="width:290px;">
                <label class="layui-form-labels">是否五保/低保：</label>
                <el-radio-group v-model="jpmData.JPMISLOW" style="margin-top:7px;">
                  <el-radio disabled  label="B">是</el-radio>
                  <el-radio disabled  label="A">否</el-radio>
                </el-radio-group> 
            </div> -->
            <div class="layui-inline">
                <label class="layui-form-label">五保/低保</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLOWTYPE" readonly></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">参保月数</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMSOCIALYEAR" readonly></el-input>
                </div>
            </div>
           <div class="layui-inline" style="width:290px;">
                <label class="layui-form-labels">是否残疾：</label>
                <el-radio-group v-model="jpmData.JPMISDEFORMITY" style="margin-top:7px;">
                  <el-radio disabled  label="B">是</el-radio>
                  <el-radio disabled  label="A">否</el-radio>
                </el-radio-group> 
            </div>
            <!-- <div class="layui-inline" style="width:290px;">
                <label class="layui-form-labels">是否交满一年社保：</label>
                <el-radio-group v-model="jpmData.JPMISSOCIAL" style="margin-top:7px;">
                  <el-radio disabled  label="B">是</el-radio>
                  <el-radio disabled  label="A">否</el-radio>
                </el-radio-group> 
            </div> -->
          </div>
          <div class="layui-form-item">
            <div class="layui-inline" style="width:900px;margin-right:0px;">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline backcolor"> 
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入备注" v-model="jpmData.JPMADUITREMARK" :readonly="isshowbeizhu"></el-input>
                </div>
            </div>
          </div>
          </fieldset>
          <fieldset class="layui-elem-field layui-field-title" v-if="true">
            <legend style="font-weight: bold;">火化信息反馈</legend>

              <div class="layui-form-item">
                <div class="layui-inline">
                  <label class="layui-form-label" style="width:90px;">火化日期</label>
                  <div class="layui-input-inline ">
                    <!-- JPMCREMATIONDATE -->
                    <el-input v-model="jpmData.JPMCREMATIONDATEDESC" readonly></el-input>
                  </div>
                </div>
              </div>


              <div class="layui-form-item">
                <div class="layui-inline">
                  <label class="layui-form-label" style="width:90px;">申请人姓名</label>
                  <div class="layui-input-inline ">
                    <el-input v-model="jpmData.JPMHANDLERNAME" readonly></el-input>
                  </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">关系</label>
                    <div class="layui-input-inline ">
                      <el-input v-model="jpmData.JPMRELATION" readonly></el-input>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">联系电话</label>
                    <div class="layui-input-inline ">
                      <el-input style="width:160px;" v-model="jpmData.JPMHANDLERLINK" readonly></el-input>
                    </div>
                </div>
              </div>

              <div class="layui-form-item">
                <div class="layui-inline">
                  <label class="layui-form-label" style="width:90px;">身份证号码</label>
                  <div class="layui-input-inline ">
                    <el-input v-model="jpmData.JPMHANDLERCARDNO" @change="(value) => identityNumber(value)" readonly></el-input>
                  </div>
                </div>
                <div class="layui-inline" style="width:575px;margin-right:0px;">
                  <label class="layui-form-label">联系地址</label>
                  <div class="layui-input-inline ">
                    <el-input class="longertext" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入详细地址" v-model="jpmData.JPMHANDLERHOUSEHOLD" readonly>
                    </el-input>
                  </div>
                </div>
                <div class="layui-inline-item">
                  <div class="layui-inline" style="width:850px;margin-right:0px;">
                      <label class="layui-form-label" style="width:90px;">备注</label>
                      <div class="layui-input-inline ">
                        <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="备注" v-model="jpmData.JPMREMARK" readonly></el-input>
                      </div>
                  </div>
                </div>
            </div>
          </fieldset>
       
        <fieldset class="layui-elem-field layui-field-title" v-if="this.title == '户口注销'">
          <legend style="font-weight: bold;">公安注销反馈</legend>

          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">办理日期</label>
              <div class="layui-input-inline ">
                <el-date-picker v-date type="date" v-model="jpmData.JPMCANCELDATE"></el-date-picker>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">单位</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMCANCELUNIT" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">人员</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMCANCELUSR" readonly></el-input>
              </div>
            </div>
          </div> 

          <div class="layui-inline-item">
            <div class="layui-inline" style="width:850px;margin-right:0px;">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="备注" v-model="jpmData.JPMCANCELREMARK"></el-input>
                </div>
            </div>
          </div>
        </fieldset>
         <fieldset class="layui-elem-field layui-field-title"  v-if="this.title != '户口注销'">
          <legend style="font-weight: bold;">公安注销反馈</legend>

          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">办理日期</label>
              <div class="layui-input-inline ">
                <!-- JPMCANCELDATE -->
                <el-input v-model="jpmData.JPMCANCELDATEDESC" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">单位</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMCANCELUNITDESC" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">人员</label>
              <div class="layui-input-inline ">
                <el-input style="width:160px;" v-model="jpmData.JPMCANCELUSR" readonly></el-input>
              </div>
            </div>
          </div> 

          <div class="layui-inline-item">
            <div class="layui-inline" style="width:900px;margin-right:0px;">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="备注" v-model="jpmData.JPMCANCELREMARK" readonly></el-input>
                </div>
            </div>
          </div>
        </fieldset>
        <!-- <fieldset class="layui-elem-field layui-field-title" v-if="true">
          <legend style="font-weight: bold;">社保信息反馈</legend>

          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">停发日期</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.regDeathDate" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">经办人员</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMSOCIALREMARK" readonly></el-input>
              </div>
            </div>
          </div> 
          
          <div class="layui-inline-item">
            <div class="layui-inline" style="width:850px;margin-right:0px;">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="备注" v-model="jpmData.JPMSOCIALREMARK" readonly></el-input>
                </div>
            </div>
          </div>

        </fieldset> -->
      </div>
      <div class="layui-form-item btnCenter">
        <el-button @click="closeDialog">取消</el-button>
        <!-- <el-button v-if="this.title == '联办详情'" type="primary" @click="submit" :loading="this.$store.state.isloading">保存</el-button> -->
        <el-button v-if="this.title == '联办审核'" type="primary" @click="submit" :loading="this.$store.state.isloading">同意</el-button>
        <el-button v-if="this.title == '联办审核'" type="primary" @click="nosubmits" :loading="this.$store.state.isloading">不同意</el-button>
        <el-button v-if="this.title == '户口注销'" type="primary" @click="submit" :loading="this.$store.state.isloading">注销</el-button>
      </div>
    </sweet-modal>
    <!-- 变更 -->
    <sweet-modal ref="change" class="dialog" :sweetModalMaxWidth="pageWidth">
      <h3>{{title}}</h3>
      <div :style="{maxHeight:maxHeight+'px'}" style="overflow:auto;">
        <fieldset class="layui-elem-field layui-field-title">
          <legend style="font-weight: bold;">死者基本信息</legend>
          <div class="layui-form-item">
            <!-- <div class="layui-inline">
              <label class="layui-form-label">逝者类型</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMTYPES" readonly></el-input>
              </div>
            </div> -->
            <div class="layui-inline">
              <label class="layui-form-label text-danger">逝者类型</label>
              <div class="layui-input-inline backcolor">
                <el-select v-model="jpmData.JPMTYPE">
                  <el-option v-for="item in szlx" :key="item.Value" :label="item.Text" :value="item.Value" :disabled="item.disabled">
                  </el-option>
                </el-select>
              </div>
            </div>
            <div class="layui-inline" style="width:575px;margin-right:0px;">
                <label class="layui-form-label">填报单位</label>
                <div class="layui-input-inline ">
                  <el-input  :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入单位" v-model="jpmData.JPMREPORTUNITDESC" readonly></el-input>
                </div>
            </div>
              <div class="layui-inline" v-if='IsHaveAcceptancePlatform'>
              <label class="layui-form-label">预约编号</label>
              <div class="layui-input-inline">
                <el-input v-model="jpmData.DECNO" style="width: 160px;" readonly></el-input>
              </div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">逝者姓名</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMNAME" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">逝者性别</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMSEXS" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">逝者年龄</label>
              <div class="layui-input-inline ">
                <el-input style="width:160px;" v-model="jpmData.JPMAGE" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline" v-if="isshowshxg">
              <label class="layui-form-label">证件类型</label>
              <div class="layui-input-inline">
                <el-input v-model="jpmData.JPMCARDTYPE" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline" style="width:575px;margin-right:0px;" v-if="isshowshxg">
                <label class="layui-form-label">证件号码</label>
                <div class="layui-input-inline">
                  <el-input class="longertext" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入证件号码" v-model="jpmData.JPMCARDNO" readonly></el-input>
                </div>
            </div>

            <div class="layui-inline" v-if="!isshowshxg">
              <label class="layui-form-label">证件类型</label> 
              <div class="layui-input-inline backcolor">
                <el-select v-model="jpmData.JPMCARDTYPE" filterable>
                  <el-option v-for="item in sfzjlx" :key="item.CODNAME" :label="item.CODALIAS" :value="item.CODNAME">
                  </el-option>
                </el-select>
              </div>
            </div>
            <div class="layui-inline" style="width:575px;margin-right:0px;" v-if="!isshowshxg">  
                <label class="layui-form-label text-danger">证件号码</label>  
                <div class="layui-input-inline backcolor">
                  <el-input class="longertext" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入证件号码" v-model="jpmData.JPMCARDNO"></el-input>
                </div>
            </div>
          </div>

          <div class="layui-inline-item">
            <div class="layui-inline" style="width:900px;margin-right:0px;">
                <label class="layui-form-label">户籍地址</label>
                <div class="layui-input-inline backcolor special">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入户籍地址" v-model="jpmData.JPMDETAILADDRESS"></el-input>
                </div>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-inline" v-if="isshowshxg">
              <label class="layui-form-label">死亡原因</label>  
              <div class="layui-input-inline">
                <el-input v-model="jpmData.JPMCAUSAS" readonly></el-input>
              </div>
              <div class="layui-input-inline">
                <el-input v-model="jpmData.JPMCAUSEOTHER"></el-input> 
              </div>
            </div>
            <div class="layui-inline" v-if="!isshowshxg">
              <label class="layui-form-label text-danger">死亡原因</label>  
              <div class="layui-input-inline backcolor">
                <el-cascader :options="cause" v-model="jpmData.JPMCAUSA" filterable>
                </el-cascader>
              </div>
              <div class="layui-input-inline">
                <el-input v-model="jpmData.JPMCAUSEOTHER" readonly></el-input>   
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">死亡地点</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMDEATHADDRESS" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline" v-if="isshowshxg">
              <label class="layui-form-label">死亡日期</label> 
              <div class="layui-input-inline">
                <el-input v-model="jpmData.JPMDEATHDATE" readonly></el-input>
              </div>
            </div>
            <div class="layui-inline" v-if="!isshowshxg">  
              <label class="layui-form-label text-danger">死亡日期</label>  
              <div class="layui-input-inline backcolor">
                <el-date-picker v-date type="date" v-model="datatime.JPMDEATHDATE"></el-date-picker>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">出生日期</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMBIRTHDATE" readonly></el-input>
              </div>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">家属姓名</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKMAN" readonly></el-input>
                </div>
            </div>
              <div class="layui-inline" v-if="isshow">
              <label class="layui-form-label">待办地址</label>
              <div class="layui-input-inline backcolor special" style="width:500px">
                <el-cascader style="width:466px" v-model="arr" :options="addressOptions" readonly>
              </el-cascader>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">证件类型</label>
              <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKLERCARDTYPE" readonly></el-input>
                </div>
            </div>
            <div class="layui-inline" style="width:575px;margin-right:0px;">
                <label class="layui-form-label">证件号码</label>
                <div class="layui-input-inline">
                  <el-input class="longertext" :autosize="{ minRows: 2, maxRows: 8}" v-model="jpmData.JPMLINKLERCARDNO" readonly></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">逝者关系</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKRELATION" readonly></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">联系电话</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKPHONE" readonly></el-input>
                </div>
            </div>
            <div class="layui-inline" v-if="this.OrganOptions.length > 1">
                <label class="layui-form-label text-danger">所属殡仪馆</label>
                <div class="layui-input-inline ">
                    <el-select v-model="jpmData.JPMPVDNO"  filterable disabled>
                        <el-option v-for="item in OrganOptions" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </div>
            </div>
          </div>

          <div class="layui-inline-item">
            <div class="layui-inline" style="width:900px;margin-right:0px;">
                <label class="layui-form-label">联系地址</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入联系地址" v-model="jpmData.JPMLINKLERHOUSEHOLD" readonly></el-input>
                </div>
            </div>
          </div>
          <!-- <div class="layui-inline-item" v-if="this.title == '户口注销'">
            <div class="layui-inline" style="width:850px;margin-right:0px;">
                <label class="layui-form-label">注销备注</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入户籍地址" v-model="jpmData.JPMCANCELREMARK"></el-input>
                </div>
            </div>
          </div> -->
          <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">五保/低保</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLOWTYPE" readonly></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">参保月数</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMSOCIALYEAR" readonly></el-input>
                </div>
            </div>
           <div class="layui-inline" style="width:290px;">
                <label class="layui-form-labels">是否残疾：</label>
                <el-radio-group v-model="jpmData.JPMISDEFORMITY" style="margin-top:7px;">
                  <el-radio disabled  label="B">是</el-radio>
                  <el-radio disabled  label="A">否</el-radio>
                </el-radio-group> 
            </div>
          </div>
          </fieldset>
      </div>
      <div class="layui-form-item btnCenter">
        <el-button v-if="isshowshxg" @click="submit">冻结</el-button>
        <el-button v-if="!isshowshxg" @click="submit">保存</el-button>
      </div>
    </sweet-modal>
    <Appendixlist ref="Uploads"></Appendixlist>

    <!-- 异地火化 -->
    <sweet-modal ref="difEaraDialog" class="dialog" :sweetModalMaxWidth="pageWidth">
      <h3>{{title}}</h3>
      <div :style="{maxHeight:maxHeight+'px'}" style="overflow:auto;">
        <fieldset class="layui-elem-field layui-field-title">
          <legend style="font-weight: bold;">死者基本信息</legend>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label text-danger">逝者类型</label>
              <div class="layui-input-inline ">
                <el-select v-model="jpmData.JPMTYPE">
                  <el-option v-for="item in difEaraszlx" :key="item.Value" :label="item.Text" :value="item.Value" :disabled="item.disabled">
                  </el-option>
                </el-select>
              </div>
            </div>
          <!-- <div class="layui-inline" v-if="this.isshowbmmc">
              <label class="layui-form-label text-danger">逝者类型</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMTYPE"></el-input>
              </div>
            </div> -->
            <div class="layui-inline" >
                <label class="layui-form-label">填报单位</label>
                <div class="layui-input-inline ">
                  <el-input :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入单位" v-model="jpmData.JPMREPORTUNITDESC" readonly></el-input>
                </div>
            </div>
             <div class="layui-inline" v-if='IsHaveAcceptancePlatform'>
              <label class="layui-form-label">预约编号</label>
              <div class="layui-input-inline">
                <el-input v-model="jpmData.DECNO" style="width: 160px;" :readonly="!isgai"></el-input>
              </div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label text-danger">逝者姓名</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMNAME"></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">逝者性别</label>
              <div class="layui-input-inline ">
                <el-select v-model="jpmData.JPMSEX" filterable>
                  <el-option v-for="item in xblx" :key="item.CODNAME" :label="item.CODALIAS" :value="item.CODNAME">
                  </el-option>
                </el-select>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">逝者年龄</label>
              <div class="layui-input-inline ">
                <el-input-number style="width:160px;" v-model="jpmData.JPMAGE" :min="0"></el-input-number>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">证件类型</label>
              <div class="layui-input-inline">
                <el-select v-model="jpmData.JPMCARDTYPE" filterable>
                  <el-option v-for="item in sfzjlx" :key="item.CODNAME" :label="item.CODALIAS" :value="item.CODNAME">
                  </el-option>
                </el-select>
              </div>
            </div>
            <div class="layui-inline" style="width:575px;margin-right:0px;">
                <label class="layui-form-label text-danger">证件号码</label>
                <div class="layui-input-inline ">
                  <el-input class="longertext" @blur="regzheng()" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入证件号码" v-model="jpmData.JPMCARDNO"></el-input>
                </div>
            </div>
          </div>

          <div class="layui-inline-item">
            <div class="layui-inline" style="width:900px;margin-right:0px;">
                <label class="layui-form-label">户籍地址</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入户籍地址" v-model="jpmData.JPMDETAILADDRESS"></el-input>
                </div>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-inline" style="width: 566px;">
              <label class="layui-form-label text-danger">死亡原因</label>
              <div class="layui-input-inline ">
                <el-cascader :options="cause" v-model="jpmData.JPMCAUSA" filterable>
                </el-cascader>
              </div>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMCAUSEOTHER"></el-input>
              </div>
            </div>
             <div class="layui-inline">
              <label class="layui-form-label">死亡地点</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMDEATHADDRESS"></el-input>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label text-danger">死亡日期</label>
              <div class="layui-input-inline ">
                <el-date-picker v-date type="date" v-model="datatime.JPMDEATHDATE"></el-date-picker>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">出生日期</label>
              <div class="layui-input-inline ">
                <el-date-picker v-date type="date" v-model="datatime.JPMBIRTHDATE"></el-date-picker>
              </div>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label text-danger">家属姓名</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKMAN"></el-input>
                </div>
            </div>
            <div class="layui-inline" v-if="isshow">
              <label class="layui-form-label text-danger">待办地址</label>
              <div class="layui-input-inline" style="width:500px">
                <el-cascader style="width:466px" v-model="arr" :options="addressOptions" clearable >
              </el-cascader>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">证件类型</label>
              <div class="layui-input-inline">
                <el-select v-model="jpmData.JPMLINKLERCARDTYPE" filterable>
                  <el-option v-for="item in sfzjlx" :key="item.CODNAME" :label="item.CODALIAS" :value="item.CODNAME">
                  </el-option>
                </el-select>
              </div>
            </div>
            <div class="layui-inline" style="width:575px;margin-right:0px;">
                <label class="layui-form-label text-danger">证件号码</label>
                <div class="layui-input-inline">
                  <el-input class="longertext" style="width: 466px;" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入证件号码" v-model="jpmData.JPMLINKLERCARDNO"></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label text-danger">逝者关系</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKRELATION"></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label text-danger">联系电话</label>
                <div class="layui-input-inline ">
                  <el-input v-model="jpmData.JPMLINKPHONE"></el-input>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label text-danger">所属殡仪馆</label>
                <div class="layui-input-inline">
                    <el-input style="width:160px" v-model="jpmData.JPMREPVDNO"></el-input>
                </div>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-inline" style="width:900px;margin-right:0px;">
                <label class="layui-form-label">联系地址</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入联系地址" v-model="jpmData.JPMLINKLERHOUSEHOLD"></el-input>
                </div>
            </div>
          </div>

         
          <div class="layui-form-item">
           <div class="layui-inline" style="width:290px;">
                <label class="layui-form-label">是否残疾：</label>
                <el-radio-group v-model="jpmData.JPMISDEFORMITY" style="margin-top:7px;">
                  <el-radio disabled label="B">是</el-radio>
                  <el-radio disabled label="A">否</el-radio>
                </el-radio-group> 
            </div>
            <!-- <div class="layui-inline" style="width:290px;">
                <label class="layui-form-labels">是否交满一年社保：</label>
                <el-radio-group v-model="jpmData.JPMISSOCIAL" style="margin-top:7px;">
                  <el-radio disabled label="B">是</el-radio>
                  <el-radio disabled label="A">否</el-radio>
                </el-radio-group> 
            </div> -->
          </div>
          </fieldset>
          <fieldset class="layui-elem-field layui-field-title">
            <legend style="font-weight: bold;">火化信息反馈</legend>

              <div class="layui-form-item">
                <div class="layui-inline">
                  <label class="layui-form-label" style="width:90px;">火化日期</label>
                  <div class="layui-input-inline ">
                    <el-date-picker v-date type="date" v-model="jpmData.JPMCREMATIONDATE"></el-date-picker>
                  </div>
                </div>
              </div>


              <div class="layui-form-item">
                <div class="layui-inline">
                  <label class="layui-form-label" style="width:90px;">申请人姓名</label>
                  <div class="layui-input-inline ">
                    <el-input v-model="jpmData.JPMHANDLERNAME"></el-input>
                  </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">关系</label>
                    <div class="layui-input-inline ">
                      <el-input v-model="jpmData.JPMRELATION"></el-input>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">联系电话</label>
                    <div class="layui-input-inline ">
                      <el-input style="width:160px" v-model="jpmData.JPMHANDLERLINK"></el-input>
                    </div>
                </div>
              </div>

              <div class="layui-form-item">
                <div class="layui-inline">
                  <label class="layui-form-label" style="width:90px;">身份证号码</label>
                  <div class="layui-input-inline ">
                    <el-input v-model="jpmData.JPMHANDLERCARDNO" @change="(value) => identityNumber(value)"></el-input>
                  </div>
                </div>
                <div class="layui-inline" style="width:575px;margin-right:0px;">
                  <label class="layui-form-label">联系地址</label>
                  <div class="layui-input-inline ">
                    <el-input class="longertext" :autosize="{ minRows: 2, maxRows: 8}" placeholder="请输入详细地址" v-model="jpmData.JPMHANDLERHOUSEHOLD">
                    </el-input>
                  </div>
                </div>
                <div class="layui-inline-item">
                  <div class="layui-inline" style="width:850px;margin-right:0px;">
                      <label class="layui-form-label" style="width:90px;">备注</label>
                      <div class="layui-input-inline ">
                        <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="备注" v-model="jpmData.JPMREMARK"></el-input>
                      </div>
                  </div>
                </div>
            </div>
          </fieldset>
        </fieldset>
        <!-- <fieldset class="layui-elem-field layui-field-title" v-if="false">
          <legend style="font-weight: bold;">社保信息反馈</legend>

          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">停发日期</label>
              <div class="layui-input-inline ">
                <el-date-picker v-date type="date" v-model="jpmData.regDeathDate"></el-date-picker>
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">经办人员</label>
              <div class="layui-input-inline ">
                <el-input v-model="jpmData.JPMSOCIALREMARK"></el-input>
              </div>
            </div>
          </div> 
          
          <div class="layui-inline-item">
            <div class="layui-inline" style="width:850px;margin-right:0px;">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline ">
                  <el-input class="longertexts" :autosize="{ minRows: 2, maxRows: 8}" placeholder="备注" v-model="jpmData.JPMSOCIALREMARK"></el-input>
                </div>
            </div>
          </div>

        </fieldset> -->
      </div>
      <div class="layui-form-item btnCenter">
        <el-button @click="closeDialog">取消</el-button>
        <el-button type="primary" @click="submit" :loading="this.$store.state.isloading">保存</el-button>
         <el-button type="primary" @click="getifmation" :loading="this.$store.state.isloading">获取</el-button>
          <!-- <el-button type="primary" @click="datas" :loading="this.$store.state.isloading">数据</el-button> -->
      </div>
    </sweet-modal>

    <!-- <sweet-modal ref="imgprint">
        <div class="usePrint">
          <img class="aaa" src="../../../static/imgs/孝文化1.png" alt="" width="200px">
        </div>
        <div id="printcontent">
          <img class="aaa" src="../../../static/imgs/孝文化1.png" alt="" width="200px">
        </div>
        <el-button @click="dayin">打印</el-button>
        <el-button @click="lodopdayin">lodop打印</el-button>
    </sweet-modal> -->
    
    <!-- 火化证明pdf-->
    <!-- <sweet-modal ref="dialog1" class="dialog" :sweetModalMaxWidth="pageWidth">
      <h3>打印火化证明</h3>
      <iframe :src="pdfUrl" style="width:1150px; height:500px;margin-top:20px;"></iframe>
    </sweet-modal> -->
    <!-- 业务流转单 -->
    <!-- <sweet-modal ref="dialog2" class="dialog" :sweetModalMaxWidth="pageWidth">
      <h3>打印业务流转单</h3>
      <iframe :src="printUrl" style="width:1150px; height:500px;margin-top:20px;"></iframe>
    </sweet-modal> -->
     <!-- 打印火化登记表 -->
    <!-- <sweet-modal ref="prints" class="dialog" :sweetModalMaxWidth="pageWidth">
      <h3>火化登记表打印</h3>
      <iframe :src="printUrl" style="width:1100px; height:500px;margin-top:20px;"></iframe>
    </sweet-modal> -->
    <!-- <checkout-add ref="checkadd"></checkout-add> -->

    <!-- <div style="display: none;">
      <object classid="clsid:090457CB-DF21-41EB-84BB-39AAFC9E271A" id="ScanCtrl" codebase="*.cab#version=1,0,0,1" width="660" height="400">
      </object>
    </div>
    <object id="view1" type="application/x-eloamplugin" width="0" height="0" name="view" />
    <object id="thumb1" type="application/x-eloamplugin" width="0" height="0" name="thumb" /> -->
  </div>
  </template>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/common.scss";
.el-button + .el-button {
  margin-left: 0;
}

.longtext {
  width: 480px;
}

.longertext {
  width: 465px;
}
.longertexts {
  width: 770px;
}

.sweet-btn {
  margin-top: 20px;
}

.layui-form-label[data-v-7e4f8d8c] {
  width: 82px;
}

.layui-form-labels[data-v-7e4f8d8c] {
  width: 100px;
  margin: 0;
}
</style>

<script>
import { ORDER } from "@/const/orderConst.js";
import apiBase from "@/api/apiBase.js";
import {
  formatDate,
  timeStringToDate,
  dateStringToDate
} from "@/utils/date.js";
import sweetModal from "@/components/sweetModal";
import Appendixlist from "./Appendixlist";
import checkoutAdd from "../businessHall/checkoutAdd";
import openidentitycard from "@/utils/openIdentityCard.js";
import { identitydata } from "@/utils/openIdentityCard.js";
import { codeValid } from "@/utils/IdentityCodeValid.js";
import { getLodop } from "@/lodop/LodopFuncs.js";
import { MessageBox, Message } from "element-ui";

export default {
  name: "cresimplereg",
  data() {
    return {
      carTimes:[], //瑞安预约时间段接收数组
      carTimenex:{},
      TSPID:null,
      showtimeduan:false,
      showmodel:null, //瑞安个性化控制预约时间显隐
      isshow: false,
      addressOptions: [], //待办地址选择
      arr: [], //待办地址id
      pageWidth: 1000,
      maxHeight: 570,
      // isshowbmmc:false,
      title: null,
      isgai: true,
      isshowbeizhu: true,
      szlx: [],
      // 异地火化身份类型
      difEaraszlx:[],
      xblx: [],
      sfzjlx: [],
      cause: [],
      jpmData: {
        JPMREPORTUNIT: null,
        JPMTYPE: null,
        JPMNAME: null,
        JPMSEX: null,
        JPMTYPES: null,
        JPMSEXS: null,
        JPMAGE: null,
        JPMCARDTYPE: null,
        JPMCARDNO: "",
        JPMDETAILADDRESS: null,
        JPMCAUSEOTHER: null,
        JPMDEATHADDRESS: null,
        JPMDEATHDATE: null,
        JPMBIRTHDATE: null,
        JPMLINKMAN: null,
        JPMLINKLERCARDTYPE: null,
        JPMLINKLERCARDNO: "",
        JPMLINKRELATION: null,
        JPMLINKPHONE: null,
        JPMLINKLERHOUSEHOLD: null,
        JPMADUITREMARK: null,
        JPMCANCELREMARK: null,
        JPMLOWTYPE: null,
        JPMSOCIALYEAR: null,
        JPMCAUSA: [],
        // JPMLOWTYPE: "A",
        JPMISDEFORMITY: "A",
        JPMISSOCIAL: "A",
        JPMCANCELDATE: null,
        JPMCANCELUNIT: null,
        JPMCANCELUSR: null,
        // 所属殡仪馆
        JPMPVDNO: localStorage.getItem("orginCode"),
        // 异地火化数据
        JPMREPVDNO: null,
        JPMCREMATIONDATE: null,
        JPMHANDLERNAME: null,
        JPMRELATION: null,
        JPMHANDLERLINK: null,
        JPMHANDLERCARDNO: null,
        JPMREMARK: null,
        JPMHANDLERHOUSEHOLD: null,
        JPMHANDLERCARDNO: null,
      },
      IsHaveAcceptancePlatform:false,
      datatime: {
        JPMDEATHDATE: null,
        JPMBIRTHDATE: null
      },
      CremationData: {},
      isshowshxg: null,
      // 所属殡仪馆列表
      OrganOptions: []
    };
    id:null;
  },
  methods: {
    //选择时间段赋值
      pickuptimedata(value){
        if(value){
        this.carTimes.forEach((item,index)=>{
          if(item.TSPID==value){
            this.carTimenex.TSKHASCOUNT=item.TSKHASCOUNT
            if(item.TSPNUBER=="999"){
               this.carTimenex.TSPNUBER="不限"
            }else{
            this.carTimenex.TSPNUBER=item.TSPNUBER
            }
          }
        })
        }else{
           this.carTimenex.TSKHASCOUNT=""
           this.carTimenex.TSPNUBER=""
        }

    },
    //选择预约日期出发事件时间段返回
    appointmentpick(){
       this.TSPID=null;
       this.carTimenex.TSPNUBER="";
       this.carTimenex.TSKHASCOUNT="";
        let data={};
        if (this.jpmData.TSKDATE) {
        data.TSKDATE = formatDate(this.jpmData.TSKDATE, "yyyyMMdd");
        }
        apiBase.DoService(
        data,
        apiBase.getApiAdress().Tsp.QueryAppointment,
        res => {
          if(res.data.content.length!=0){
            this.showtimeduan=true
            this.carTimes=res.data.content //获取下拉值
          }else{
            this.showtimeduan=false
            this.carTimes=[]
          }
        }
      );
    },
    //联办新增是否显示待办地址
    Ifshow() {
      apiBase.DoService(
        {},
        apiBase.getApiAdress().Param.GetIsAddJointDisplayAddress,
        res => {
          this.isshow = res.data.content;
        }
      );
    },
    GetIsHaveAcceptancePlatform(){
      apiBase.DoService(
        {},
        apiBase.getApiAdress().Param.GetIsHaveAcceptancePlatform,
        res => {
          this.IsHaveAcceptancePlatform = res.data.content;
        }
      );
    },
    GetIsShowTspCarForLBDD(){
      apiBase.DoService(
        {},
        apiBase.getApiAdress().Param.GetIsShowTspCarForLBDD,
        res => {
          this.showmodel = res.data.content;
        }
      );
    },
    restructur(value) {
      let arr = JSON.parse(JSON.stringify(value));
      var data = [];
      arr.forEach(item => {
        if (item.Children.length > 0) {
          data.push({
            label: item.SARNAME,
            value: item.SARID,
            children: this.restructur(item.Children)
          });
        } else {
          data.push({
            label: item.SARNAME,
            value: item.SARID
          });
        }
      });
      return data;
    },
    init() {
      // 获取级联选择
      apiBase.DoService({}, apiBase.getApiAdress().Code.GetBorough, res => {
        let data = res.data.content;
        this.addressOptions = data.map(item => ({
          label: item.SARNAME,
          value: item.SARID,
          children: item.Children.map(item => ({
            label: item.SARNAME,
            value: item.SARID,
            children: this.restructur(item.Children)
          }))
        }));
      });
    },

    // 证件号码验证
    //  JPMCARDNO-- 请求参数，证件号码+
    regzheng() {
      apiBase.DoService(
        { JPMCARDNO: this.jpmData.JPMCARDNO },
        apiBase.getApiAdress().JointRegistration.CheckIdCard,
        res => {}
      );
    },
     //出生日期改变触发
        birthdaydata(val) {
          if(val){
          if(this.datatime.JPMDEATHDATE){
            let now = this.datatime.JPMDEATHDATE;
            var nY = now.getFullYear();
            var nM = now.getMonth() + 1;
            var nD = now.getDate();
            if (val) {
                var dY = val.getFullYear();
                var dM = val.getMonth() + 1;
                var dD = val.getDate();
                var adjust;
                if (nM * 31 + nD >= dM * 31 + dD) {
                    adjust = 0;
                } else adjust = -1;
                this.jpmData.JPMAGE = now.getFullYear() - val.getFullYear() + adjust;
            }
          }else{
            // this.regData.REGBIRTHDATE = formatDate(val, "yyyyMMdd");
            let now = new Date();
            var nY = now.getFullYear();
            var nM = now.getMonth() + 1;
            var nD = now.getDate();
            if (val) {
                var dY = val.getFullYear();
                var dM = val.getMonth() + 1;
                var dD = val.getDate();
                var adjust;
                if (nM * 31 + nD >= dM * 31 + dD) {
                    adjust = 0;
                } else adjust = -1;
                this.jpmData.JPMAGE = now.getFullYear() - val.getFullYear() + adjust;
            }
          }
        }
        },
    getCode() {
      let data = {};
      apiBase.DoService(
        data,
        apiBase.getApiAdress().Registration.QueryAllCode,
        res => {
          this.codeList = res.data.content;
          for (var i in this.codeList) {
            switch (this.codeList[i].CTPID) {
              case "性别类型":
                this.xblx = this.codeList[i].Cods;
                break;
              case "身份证件类型":
                this.sfzjlx = this.codeList[i].Cods;
                this.jpmData.JPMCARDTYPE = this.sfzjlx[0].CODNAME;
                this.jpmData.JPMLINKLERCARDTYPE = this.sfzjlx[0].CODNAME;
                break;
              default:
            }
          }
        }
      );
    },
    //根据身份证号码等获取数据
    getifmation() {
      // let data = JSON.parse(JSON.stringify(this.jpmData));
      // data.JPMCAUSA = this.jpmData.JPMCAUSA[0];
      // data.JPMCAUSASON = this.jpmData.JPMCAUSA[1];
      // data.JPMREPORTUNIT = this.jpmData.JPMREPORTUNITDESC;
      // if(this.datatime.JPMDEATHDATE){
      //   data.JPMDEATHDATE =  formatDate(this.datatime.JPMDEATHDATE, "yyyyMMdd");
      // };
      // if(this.datatime.JPMBIRTHDATE){
      //   data.JPMBIRTHDATE =  formatDate(this.datatime.JPMBIRTHDATE, "yyyyMMdd");
      // };
      let data = {
        JPMCARDNO: this.jpmData.JPMCARDNO,
        JPMLINKLERCARDNO: this.jpmData.JPMLINKLERCARDNO
      };
      apiBase.DoService(
        data,
        apiBase.getApiAdress().JointRegistration.InterFaceCall,
        res => {
          let getdatas = res.data.content;
          this.datatime.JPMBIRTHDATE = getdatas.JPMBIRTHDATEDESC; //逝者出生日期
          this.jpmData.JPMSEX = getdatas.JPMSEX; //逝者性别
          this.jpmData.JPMNAME = getdatas.JPMNAME; //逝者姓名
          this.jpmData.JPMDETAILADDRESS = getdatas.JPMDETAILADDRESS; //户籍地址
          this.jpmData.JPMLOWTYPE = getdatas.JPMLOWTYPE; //低保类型
          this.jpmData.JPMLINKMAN = getdatas.JPMLINKMAN; //联系人姓名
          this.jpmData.JPMLINKLERHOUSEHOLD = getdatas.JPMLINKLERHOUSEHOLD; //联系人地址
          this.jpmData.JPMSOCIALYEAR = getdatas.JPMSOCIALYEAR; //社保备注填写缴纳社保月数
          if(getdatas.JPMAGE!=""||getdatas.JPMAGE!=null){
            this.jpmData.JPMAGE = getdatas.JPMAGE; //年龄
          }
        }
      );
    },

    //获取逝者类型
    getReserveInfo() {
      let data = {};
      apiBase.DoService(
        data,
        apiBase.getApiAdress().JointRegistration.GetJpmType,
        res => {
          this.szlx = res.data.content;
          if (this.jpmData.JPMREPORTUNITDESC === "公安") {
            this.jpmData.JPMTYPE = "C";
          } else if (this.jpmData.JPMREPORTUNITDESC === "殡仪馆") {
            this.jpmData.JPMTYPE = "D";
          } else {
            this.jpmData.JPMTYPE = null;
          }
          // 殡仪馆类型只能选择遗体外运 不是殡仪馆不能选择遗体外运
          if (this.jpmData.JPMREPORTUNITDESC != "殡仪馆") {
            if(localStorage.getItem('pvdid').indexOf('F') == -1){
              for (var i = 0; i < this.szlx.length; i++) {
                if (this.szlx[i].Value == "D") {
                  this.szlx[i].disabled = true;
                }
              }
            }
          }
        }
      );
    },
    // 获取异地火化逝者类型
    getDifEaraOption(){
      apiBase.DoService(
        {},
        apiBase.getApiAdress().JointRegistration.GetDiffJpmType,
        res => {
          this.difEaraszlx = res.data.content;
          this.jpmData.JPMTYPE = this.difEaraszlx[0].Value
        }
      );
    },


    //获取当前部门名称
    getbmname() {
      let data = {};
      apiBase.DoService(
        data,
        apiBase.getApiAdress().JointRegistration.GetDpeName,
        res => {
          var s = res.data.content.DPTNAME;
          this.jpmData.JPMREPORTUNITDESC = s;
          this.jpmData.JPMCANCELUNIT = s;
          // if(s === "殡仪馆"){
          //   this.isshowbmmc = true;
          // }
        }
      );
    },
    // 获取所属殡仪馆
    getOrgan() {
      apiBase.DoService(
        {},
        apiBase.getApiAdress().JointRegistration.QueryOrgan,
        res => {
          let options = res.data.content;
          this.jpmData.JPMPVDNO = options[0].ORGID;
          this.OrganOptions = options.map(item => {
            if (localStorage.getItem("orginCode") === item.ORGDTRCODE) {
              this.jpmData.JPMPVDNO = item.ORGID;
            }
            return (item = {
              label: item.ORGNAME,
              value: item.ORGID,
              code: item.ORGDTRCODE
            });
          });
        }
      );
    },

    //获取死亡原因
    getCausa() {
      let data = {};
      apiBase.DoService(data, apiBase.getApiAdress().Code.GetCausa, res => {
        let caudata = res.data.content;
        this.cause = caudata.map(item => ({
          label: item.CAENAME,
          value: item.CAEID,
          children: item.Caus.map(itemCau => ({
            label: itemCau.CAUNAME,
            value: itemCau.CAUID
          }))
        }));
        if (this.cause[0] && this.cause[0].children[0])
          this.cauinfo = [this.cause[0].value, this.cause[0].children[0].value];
      });
    },
    //获取详情
    getLianbanDetail(id,val) {
      let data = {
        JPMID: id
      };
      apiBase.DoService(
        data,
        apiBase.getApiAdress().JointRegistration.DetailAll,   
        res => {
          let datalist= res.data.content;
          this.jpmData = res.data.content;
          if(datalist.TSKDATE){
            this.jpmData.TSKDATE=datalist.TSKDATEDESC
            this.appointmentpick()
            this.showtimeduan=true;
            if(datalist.TSPID){
            this.TSPID=datalist.TSPID;
            this.carTimenex.TSKHASCOUNT=datalist.TSKHASCOUNT;
            this.carTimenex.TSPNUBER=datalist.TSPNUBER;
            }else{}
          }else{
            this.showtimeduan=false;
          }
          if (this.isshow == true) {
            this.arr = res.data.content.JPMSARID.split(",");
          }
          this.jpmData.JPMREPORTUNIT = res.data.content.JPMREPORTUNIT;
          this.jpmData.JPMREPORTUNITDESC = res.data.content.JPMREPORTUNITDESC;
          if(val=="受理"){
           this.getbmname()
          }
     
          this.jpmData.DECNO = res.data.content.DECNO; //预约编号
          this.jpmData.JPMCAUSAS =
            res.data.content.JPMCAUSADESC +
            "/" +
            res.data.content.JPMCAUSASONDESC;
          this.jpmData.JPMDEATHDATE = res.data.content.JPMDEATHDATEDESC; //死亡日期   JPMDEATHDATEDESC
          // JPMDEATHDATEDESC
          this.datatime.JPMDEATHDATE = res.data.content.JPMDEATHDATEDESC; //死亡日期  JPMDEATHDATEDESC

          this.jpmData.JPMBIRTHDATE = res.data.content.JPMBIRTHDATEDESC; //出生日期
          this.datatime.JPMBIRTHDATE = res.data.content.JPMBIRTHDATEDESC; //出生日期
          if(res.data.content.JPMAGE){
             this.jpmData.JPMAGE=res.data.content.JPMAGE
          }else{
          this.birthdaydata(this.datatime.JPMBIRTHDATE)   //算年龄
          }
          this.jpmData.JPMSEX = res.data.content.JPMSEX;
          this.jpmData.JPMSEXS = res.data.content.JPMSEXDESC;
          this.jpmData.JPMCAUSA = [
            res.data.content.JPMCAUSA,
            res.data.content.JPMCAUSASON
          ];
          this.jpmData.JPMTYPES = res.data.content.JPMTYPEDESC;
          this.jpmData.JPMADUITREMARK = res.data.content.JPMADUITREMARK;
          // if(this.title === '变更详情'){
          //   this.jpmData.JPMTYPE = "C";
          // }
          if (this.title === "冻结") {
            this.jpmData.JPMTYPE = "C";
          }
          if (this.title === "户口注销") {
            this.getbmname();
            this.jpmData.JPMCANCELUSR = localStorage.getItem("username");
          }
        }
      );
    },
    //初始化下拉框数据
    initSelectData() {
      //获取逝者类型
      this.getReserveInfo();
      // this.getbmname();
      this.getCode();
      this.getCausa();
      this.getOrgan();
    },
    //打开页面
    open(order, id) {
      this.clearcolor();
      this.isshowbeizhu = true;
      this.order = order;
      this.id = id;
      this.maxHeight = window.innerHeight - 240;
      //清理数据
      this.dataRepeat();
      switch (this.order) {
        case "新增": //联办新增
          this.getbmname();
          this.initSelectData();
          this.title = "联办新增";
          this.$refs.dialog.open();
          this.isgai = true;
          break;
        case "异地火化": //联办新增
          this.getbmname();
          this.initSelectData();
          this.getDifEaraOption()
          this.title = "异地火化";
          this.$refs.difEaraDialog.open();
          this.isgai = true;
          break;
        case "修改": //登记修改
          this.title = "联办修改";
          this.getLianbanDetail(id);
          this.$refs.dialog.open();
          this.isgai = false;
          break;
        case "受理": //登记修改
          this.title = "联办受理";
          this.getLianbanDetail(id,"受理");
          this.$refs.dialog.open();
          this.isgai = false;
          break;
        case "详情": //登记详情
          this.title = "联办详情";
          this.getLianbanDetail(id);
          this.$refs.dialogdetail.open();
          break;
        case "变更": //变更
          this.title = "冻结";
          this.isshowshxg = true;
          this.getbmname();
          this.getReserveInfo(); //获取逝者类型
          this.getLianbanDetail(id); //详情
          this.$refs.change.open();
          break;
        case "审核修改":
        case "地址修改":
          this.title = order;
          this.isshowshxg = false;
          this.getbmname();
          setTimeout(() => {
            this.changecolor();
          }, 100);

          this.getReserveInfo(); //获取逝者类型
          this.getLianbanDetail(id); //详情
          this.$refs.change.open();
          break;
        case "注销": //户口注销
          this.title = "户口注销";
          this.getLianbanDetail(id);
          this.$refs.dialogdetail.open();
          break;
        case "办结": //户口注销
          this.title = "户口办结";
          this.getLianbanDetail(id);
          this.$refs.dialogdetail.open();
          break;
        case "审核": //审核
          this.title = "联办审核";
          this.isshowbeizhu = false;
          this.getLianbanDetail(id);
          this.changecolor();
          this.$refs.dialogdetail.open();
          break;
        case "1":
        // this.$refs.imgprint.open();
        default:
      }
    },
    dayin() {
      // window.print();

      //     var printHtml=document.getElementsByClassName('aaa'),
      //     newWindow=window.open("",'newWindow');
      //     newWindow.document.body.innerHTML = printHtml;
      //     newWindow.print();

      //判断iframe是否存在，不存在则创建iframe
      var iframe = document.getElementById("print-iframe");
      if (!iframe) {
        var el = document.getElementById("printcontent");
        iframe = document.createElement("IFRAME");
        var doc = null;
        iframe.setAttribute("id", "print-iframe");
        // iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
        document.body.appendChild(iframe);
        doc = iframe.contentWindow.document;
        //这里可以自定义样式
        //doc.write("<LINK rel="stylesheet" type="text/css" href="css/print.css">");
        doc.write("<div>" + el.innerHTML + "</div>");
        doc.close();
        iframe.contentWindow.focus();
      }
      setTimeout(() => {
        iframe.contentWindow.print();
      }, 100);
      if (navigator.userAgent.indexOf("MSIE") > 0) {
        document.body.removeChild(iframe);
      }
    },
    lodopdayin() {
      // 第一种方法
      var LODOP = getLodop();
      LODOP.PRINT_INIT("打印常用证明1");
      LODOP.ADD_PRINT_HTM(
        0,
        0,
        "100%",
        "100%",
        document.getElementById("printcontent").innerHTML
      );
      LODOP.SET_PRINT_STYLE("ItemType", 0);
      LODOP.PRINT();

      // 第二种方法 会弹出打印设置页面
      // var LODOP=getLodop();
      // LODOP.PRINT_INIT("打印常用证明2");
      // var strHTML="<body style='margin:0;background-color: white'>"+document.getElementById("printcontent").innerHTML+"</body>";
      // LODOP.ADD_PRINT_HTM("0mm",0,"RightMargin:0.1cm","BottomMargin:1mm",strHTML);
      // LODOP.PREVIEW();

      //第三种方法 连续打印多张
      // LODOP=getLodop();
      // LODOP.PRINT_INIT("打印常用证明3");
      // LODOP.ADD_PRINT_IMAGE(0,0,"100%","100%",document.getElementById("printcontent").innerHTML);
      // LODOP.SET_PRINT_STYLEA(0,"Stretch",2);//按原图比例(不变形)缩放模式
      // LODOP.SET_PRINT_COPIES(5); //打印五份
      // LODOP.PRINT();
    },
    //提交
    submit(checkout = false) {
      switch (this.order) {
        case "新增":
          this.dataAdd(); //登记新增
          break;
        case "异地火化":
          this.dataAdd(); // 异地火化
          break;
        case "修改":
          this.changedata(); //登记修改
          break;
        case "受理":
          this.dataAdd(); //登记受理
          break;
        case "审核":
          this.shenhe(); //登记修改
          break;
        case "注销":
          this.Cancellation(); //户口注销
          break;
        case "变更":
          this.changes(); //户口注销
          break;
        case "审核修改":
        case "地址修改":
          this.examine();
          break;
        default:
      }
    },
    // //取消审核
    // cancelExamine() {
    //    this.$confirm("确定取消审核吗?", "提示", {
    //     confirmButtonText: "确定",
    //     cancelButtonText: "取消",
    //     type: "warning"
    //     }).then(callback =>
    //      {
    //         var data = {
    //           JPMID: this.id,
    //           JPMADUITREMARK: this.jpmData.JPMADUITREMARK
    //         };
    //         apiBase.DoService(data, apiBase.getApiAdress().JointRegistration.CancelVerify, res => {
    //           this.getData();
    //         });
    //       });
    // },
    //取消提交
    nosubmits() {
      this.$confirm("是否取消提交该数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(callback => {
        var data = {
          JPMID: this.id,
          JPMADUITREMARK: this.jpmData.JPMADUITREMARK
        };
        apiBase.DoService(
          data,
          apiBase.getApiAdress().JointRegistration.CancelSubmit,
          res => {
            this.$refs.dialogdetail.close();
            this.refreshData();
          }
        );
      });
    },
    //变更
    changes() {
      let data = {
        JPMID: this.id,
        JPMTYPE: this.jpmData.JPMTYPE,
        JPMCAUSEOTHER: this.jpmData.JPMCAUSEOTHER,
        JPMPVDNO: this.jpmData.JPMPVDNO
      };
      apiBase.DoService(
        data,
        apiBase.getApiAdress().JointRegistration.Change,
        res => {
          this.$message({
            type: "success",
            message: "变更成功!"
          });
          this.$refs.change.close();
          this.refreshData();
        }
      );
    },
    //审核修改  JPMCARDTYPE JPMCARDNO JPMCAUSA JPMCAUSEOTHER JPMDEATHDATE
    examine() {
      if(this.order == '审核修改'){
        let data = {
          JPMID: this.id,
          JPMTYPE: this.jpmData.JPMTYPE,
          JPMDETAILADDRESS: this.jpmData.JPMDETAILADDRESS,
          JPMSARID: this.arr[this.arr.length - 1],
          JPMCARDTYPE: this.jpmData.JPMCARDTYPE,
          JPMCARDNO: this.jpmData.JPMCARDNO,
          JPMCAUSA: this.jpmData.JPMCAUSA[0],
          JPMCAUSASON: this.jpmData.JPMCAUSA[1],
          JPMDEATHDATE: formatDate(this.datatime.JPMDEATHDATE, "yyyyMMdd"),
          JPMPVDNO: this.jpmData.JPMPVDNO
        };
      }else if(this.order == '地址修改'){
        let data = {
          JPMID: this.id,
          JPMDETAILADDRESS: this.jpmData.JPMDETAILADDRESS,
          JPMSARID: this.arr[this.arr.length - 1],
        };
      }
      let data = {
        JPMID: this.id,
        JPMTYPE: this.jpmData.JPMTYPE,
        JPMDETAILADDRESS: this.jpmData.JPMDETAILADDRESS,
        JPMSARID: this.arr[this.arr.length - 1],
        JPMCARDTYPE: this.jpmData.JPMCARDTYPE,
        JPMCARDNO: this.jpmData.JPMCARDNO,
        JPMCAUSA: this.jpmData.JPMCAUSA[0],
        JPMCAUSASON: this.jpmData.JPMCAUSA[1],
        JPMDEATHDATE: formatDate(this.datatime.JPMDEATHDATE, "yyyyMMdd"),
        JPMPVDNO: this.jpmData.JPMPVDNO
      };
      apiBase.DoService(
        data,
        apiBase.getApiAdress().JointRegistration.VerifyModify,
        res => {
          this.$message({
            type: "success",
            message: "修改成功!"
          });
          this.$refs.change.close();
          this.refreshData();
        }
      );
    },

    //注销
    Cancellation() {
      // jpmData.JPMCANCELDATEDESC jpmData.JPMCANCELUNIT jpmData.JPMCANCELUSR
      let data = {
        JPMID: this.id,
        JPMCANCELREMARK: this.jpmData.JPMCANCELREMARK,
        JPMCANCELUNIT: this.jpmData.JPMCANCELUNIT,
        JPMCANCELUSR: this.jpmData.JPMCANCELUSR
      };
      if (this.jpmData.JPMCANCELDATE) {
        data.JPMCANCELDATE = formatDate(this.jpmData.JPMCANCELDATE, "yyyyMMdd");
      }
      apiBase.DoService(
        data,
        apiBase.getApiAdress().JointRegistration.Cancel,
        res => {
          this.$message({
            type: "success",
            message: "注销成功!"
          });
          this.$refs.dialogdetail.close();
          this.refreshData();
        }
      );
    },
    //审核
    shenhe() {
      let data = {
        JPMID: this.id,
        JPMADUITREMARK: this.jpmData.JPMADUITREMARK
      };
      apiBase.DoService(
        data,
        apiBase.getApiAdress().JointRegistration.Verify,
        res => {
          this.$message({
            type: "success",
            message: "审核成功!"
          });
          this.$refs.dialogdetail.close();
          this.refreshData();
        }
      );
    },
    //新增提交
    dataAdd() {
      let data = JSON.parse(JSON.stringify(this.jpmData));
      if(this.order == '异地火化'){
        data.JPMPVDNO= null
        if (data.JPMCREMATIONDATE) {
          data.JPMCREMATIONDATE = formatDate(data.JPMCREMATIONDATE, "yyyyMMdd");
        }
      }
      if (this.isshow == true) {
        data.JPMSARID = this.arr[this.arr.length - 1]; //地址
      }
      data.JPMCAUSA = this.jpmData.JPMCAUSA[0];
      data.JPMCAUSASON = this.jpmData.JPMCAUSA[1];
      data.JPMREPORTUNIT = this.jpmData.JPMREPORTUNITDESC;
      data.DECNO = this.jpmData.DECNO; //预约编号
      if (this.datatime.JPMDEATHDATE) {
        data.JPMDEATHDATE = formatDate(this.datatime.JPMDEATHDATE, "yyyyMMdd");
      }
      if (this.datatime.JPMBIRTHDATE) {
        data.JPMBIRTHDATE = formatDate(this.datatime.JPMBIRTHDATE, "yyyyMMdd");
      }
      if (data.JPMCARDTYPE === "内地居民身份证" && data.JPMCARDNO.length > 0) {
        if (!codeValid(data.JPMCARDNO)) {
          this.$message({
            type: "error",
            message: "逝者身份证号码有误！"
          });
          return;
        }
      }
      if (
        data.JPMLINKLERCARDTYPE === "内地居民身份证" &&
        data.JPMLINKLERCARDNO.length > 0
      ) {
        if (!codeValid(data.JPMLINKLERCARDNO)) {
          this.$message({
            type: "error",
            message: "家属身份证号码有误！"
          });
          return;
        }
      }
      // 提交预约时间段
      if(this.showmodel==true){
        if (this.jpmData.TSKDATE) {
          data.TSKDATE = formatDate(this.jpmData.TSKDATE, "yyyyMMdd");
        }else{}
        if(this.TSPID){ data.TSPID=this.TSPID }else{data.TSPID=null}
      }else{}
      apiBase.DoService(
        data,
        apiBase.getApiAdress().JointRegistration.Create,
        res => {
          // this.InTerSbCall(res.data.content.JPMID);
          this.$message({
            type: "success",
            message: "登记成功!"
          });
          this.closeDialog()
          this.refreshData();
          this.$refs.Uploads.operate("附件上传", res.data.content.JPMID);
        }
      );
    },
    //在保存和修改后给后台发送一个JPMID
    // InTerSbCall(id){
    //   let data = {
    //     JPMID: id
    //   }
    //   apiBase.DoService(
    //     data,
    //     apiBase.getApiAdress().JointRegistration.InTerSbCall,
    //     res => {
    //       console.log(222333);
    //       console.log(res);
    //     }
    //   );
    // },
    //修改
    changecolor() {
      let backcolor = "";
      let inputss = document.querySelectorAll(
        ".backcolor input.el-input__inner"
      );
      if(this.order == '地址修改'){
        inputss = document.querySelectorAll(
          ".backcolor.special input.el-input__inner"
        )
      }
      backcolor = "rgb(255,255,153)";
      for (var i = 0; i < inputss.length; i++) {
        inputss[i].style.backgroundColor = backcolor;
      }
    },
    clearcolor() {
      let backcolorss = "";
      const input = document.querySelectorAll(
        ".backcolor input.el-input__inner"
      );
      backcolorss = "";
      for (var i = 0; i < input.length; i++) {
        input[i].style.backgroundColor = backcolorss;
      }
    },
    changedata() {
      let data = JSON.parse(JSON.stringify(this.jpmData));
      if (this.isshow == true) {
        data.JPMSARID = this.arr[this.arr.length - 1]; //地址
      }
      data.JPMCAUSA = this.jpmData.JPMCAUSA[0];
      data.JPMCAUSASON = this.jpmData.JPMCAUSA[1];
      //死亡日期
      if (this.datatime.JPMDEATHDATE) {
        data.JPMDEATHDATE = formatDate(this.datatime.JPMDEATHDATE, "yyyyMMdd");
      }
      //出生日期
      if (this.datatime.JPMBIRTHDATE) {
        data.JPMBIRTHDATE = formatDate(this.datatime.JPMBIRTHDATE, "yyyyMMdd");
      }
      if (data.JPMCARDTYPE === "内地居民身份证" && data.JPMCARDNO.length > 0) {
        if (!codeValid(data.JPMCARDNO)) {
          this.$message({
            type: "error",
            message: "逝者身份证号码有误！"
          });
          return;
        }
      }
      if (
        data.JPMLINKLERCARDTYPE === "内地居民身份证" &&
        data.JPMLINKLERCARDNO.length > 0
      ) {
        if (!codeValid(data.JPMLINKLERCARDNO)) {
          this.$message({
            type: "error",
            message: "家属身份证号码有误！"
          });
          return;
        }
      }
      // 提交预约时间段
      if(this.showmodel==true){
      if (this.jpmData.TSKDATE) {
        data.TSKDATE = formatDate(this.jpmData.TSKDATE, "yyyyMMdd");
        }else{}
        if(this.TSPID){ data.TSPID=this.TSPID }else{data.TSPID=null}
      }else{}
      apiBase.DoService(
        data,
        apiBase.getApiAdress().JointRegistration.Modify,
        res => {
          //  this.InTerSbCall(res.data.content.JPMID);
          this.$message({
            type: "success",
            message: "修改成功!"
          });
          this.$refs.dialog.close();
          this.refreshData();
        }
      );
    },
    refreshData() {
      this.$emit("refreshData");
    },
    //取消按钮
    closeDialog() {
      if (this.order === "新增") this.$refs.dialog.close();
      else if (this.order === "详情") this.$refs.dialogdetail.close();
      else if (this.order === "审核") this.$refs.dialogdetail.close();
      else if (this.order === "注销") this.$refs.dialogdetail.close();
      else if (this.order === "修改") this.$refs.dialog.close();
      else if (this.order === "受理") this.$refs.dialog.close();
      else if (this.order === "异地火化") this.$refs.difEaraDialog.close();
    },

    // refreshData() {
    //   this.$emit("refreshData");
    // },
    //数据重置
    dataRepeat() {
      // Object.assign(this.$data.jpmData, this.$options.data().jpmData);
      this.jpmData= {
        JPMREPORTUNIT: null,
        JPMTYPE: null,
        JPMNAME: null,
        JPMSEX: null,
        JPMTYPES: null,
        JPMSEXS: null,
        JPMAGE: null,
        JPMCARDTYPE: null,
        JPMCARDNO: "",
        JPMDETAILADDRESS: null,
        JPMCAUSEOTHER: null,
        JPMDEATHADDRESS: null,
        JPMDEATHDATE: null,
        JPMBIRTHDATE: null,
        JPMLINKMAN: null,
        JPMLINKLERCARDTYPE: null,
        JPMLINKLERCARDNO: "",
        JPMLINKRELATION: null,
        JPMLINKPHONE: null,
        JPMLINKLERHOUSEHOLD: null,
        JPMADUITREMARK: null,
        JPMCANCELREMARK: null,
        JPMLOWTYPE: null,
        JPMSOCIALYEAR: null,
        JPMCAUSA: [],
        // JPMLOWTYPE: "A",
        JPMISDEFORMITY: "A",
        JPMISSOCIAL: "A",
        JPMCANCELDATE: null,
        JPMCANCELUNIT: null,
        JPMCANCELUSR: null,
        // 所属殡仪馆
        JPMPVDNO: localStorage.getItem("orginCode"),
        // 异地火化数据
        JPMREPVDNO: null,
        JPMCREMATIONDATE: null,
        JPMHANDLERNAME: null,
        JPMRELATION: null,
        JPMHANDLERLINK: null,
        JPMHANDLERCARDNO: null,
        JPMREMARK: null,
        JPMHANDLERHOUSEHOLD: null,
        JPMHANDLERCARDNO: null,
      };
      this.datatime.JPMBIRTHDATE = null;
      this.datatime.JPMDEATHDATE = null;
      this.jpmData.DECNO = null;
      this.arr=[];
      this.TSPID=null;
      this.carTimes=[];//瑞安预约时间段接收数组
      this.carTimenex={};
      this.showtimeduan=false;
    }
  },
  components: {
    sweetModal,
    checkoutAdd,
    Appendixlist
  },
  computed: {},
  mounted() {
    //在模板渲染成html后调用，通常是初始化页面完成后，再对html的dom节点进行一些需要的操作。
    this.getbmname();
  },
  created() {
    //在模板渲染成html前调用，即通常初始化某些属性值，然后再渲染成视图。
    this.initSelectData();
    this.init();
    this.Ifshow();
    this.GetIsHaveAcceptancePlatform()
    this.GetIsShowTspCarForLBDD()
  },

  watch: {
    //  "jpmData.JPMDEATHDATE": function(val) {
    //   this.jpmData.JPMDEATHDATE = formatDate(val, "yyyyMMdd");
    // },
  }
};
</script>
